#include "mainslotadpter.h"
#include "form/homewindow.h"


MainSlotAdpter::MainSlotAdpter(HomeWindow* _w) : BaseSlotAdpter(), homeWindow(_w)
{

}

void MainSlotAdpter::netStateSlots(int e)
{
    if(e == QAbstractSocket::UnconnectedState)
    {
        homeWindow->flushNetStatus("控制器:连接失败！");
    }
    else if(e == QAbstractSocket::ConnectingState)
    {
        homeWindow->flushNetStatus("控制器:正在连接！");
    }
    else if(e == QAbstractSocket::ConnectedState)
    {
        homeWindow->flushNetStatus("控制器:连接成功！");
    }

}

void MainSlotAdpter::netDisconnected()
{
    homeWindow->flushNetStatus("控制器:断开连接！");
}

void MainSlotAdpter::netConnected()
{
    homeWindow->flushNetStatus("控制器:连接成功！");
}
